<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>类定义Class</title>
    <script>
      class peopler {
        constructor(name, age) {
          this.name = name;
          this.age = age;
        }
        show() {
          console.log(`球员信息：姓名：${this.name}，年龄：${this.age}`);
        }
        static info() {
          console.log("这是一个定义球员的类");
        }
      }
      peopler.info(); //静态方法只能有类调用，不能变量调用
      let people = new peopler("lmx", "21");
      people.show();
    </script>
  </head>
  <body></body>
</html>
